<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>UCARPP: includes/gMatrix.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">UCARPP
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('gMatrix_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">includes/gMatrix.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="edgeID_8h_source.html">edgeID.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for gMatrix.h:</div>
<div class="dyncontent">
<div class="center"><img src="gMatrix_8h__incl.png" border="0" usemap="#includes_2gMatrix_8h" alt=""/></div>
<map name="includes_2gMatrix_8h" id="includes_2gMatrix_8h">
<area shape="rect" id="node5" href="edgeID_8h.html" title="edgeID.h" alt="" coords="81,83,156,112"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="gMatrix_8h__dep__incl.png" border="0" usemap="#includes_2gMatrix_8hdep" alt=""/></div>
<map name="includes_2gMatrix_8hdep" id="includes_2gMatrix_8hdep">
<area shape="rect" id="node3" href="add_8h.html" title="includes/add.h" alt="" coords="5,315,112,344"/><area shape="rect" id="node5" href="solution_8h.html" title="includes/solution.h" alt="" coords="411,160,541,189"/><area shape="rect" id="node16" href="remove_8h.html" title="includes/remove.h" alt="" coords="163,315,291,344"/><area shape="rect" id="node25" href="operations_8h.html" title="includes/operations.h" alt="" coords="480,83,624,112"/><area shape="rect" id="node7" href="los_8h.html" title="includes/los.h" alt="" coords="337,237,439,267"/><area shape="rect" id="node10" href="stm_8h.html" title="includes/stm.h" alt="" coords="328,315,435,344"/><area shape="rect" id="node14" href="ltm_8h.html" title="rappresenta il livello LTM dell&#39;algoritmo UCARPP" alt="" coords="560,469,661,499"/><area shape="rect" id="node18" href="swap_8h.html" title="includes/swap.h" alt="" coords="459,315,573,344"/><area shape="rect" id="node20" href="graphbmp-tools_8h.html" title="includes/graphbmp&#45;tools.h" alt="" coords="140,237,313,267"/><area shape="rect" id="node12" href="LTMConfiguration_8h.html" title="includes/LTMConfiguration.h" alt="" coords="337,392,524,421"/></map>
</div>
</div>
<p><a href="gMatrix_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structGMatrix.html">GMatrix</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#ab2c41215b98f316fe94885cf46f02e29">NOT_GATHERED</a>&#160;&#160;&#160;-1</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structGMatrix.html">GMatrix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#ab8c4af12319bc3765212016cf5445a5c">GMatrix</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structGMatrix.html">GMatrix</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#aa7c34686fbe4ead2d3a4c354565bda0a">initGMatrix</a> (int *_N, int _basevalue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#aff58909e3b768c5f155cb4cc570abadb">freeGMatrix</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> matrix)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a59e42cb9751a14215fcf6ba9fc7fbcf6">cloneGMatrix</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> matrix)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a16918ac489e56a65e094ff74c1ef9da5">printGMatrix</a> (FILE *f, <a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> matrix)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#aaf280fbab5859ed2ed00952a71788397">whoGathersEdge</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> pgm, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pe)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a751162c0808d8bb942d02a1bdea1ec8a">isEdgeGathered</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> pgm, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pe)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a986e2aa8b907c502bc90c43720d7dfd8">amIGatheringEdge</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> p_gMatrix, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> p_edgeID, int k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a864195e0b74f3b55c4ff17c80c148010">releaseIfImGatheringEdge</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> p_gMatrix, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> p_edgeID, int k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a8b7e4bf17f06761e65a48e8dd415e826">tryToGatherEdge</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> pgm, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pe, int k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a44cbe441c402fb796126df3182862d18">gatherEdge</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> pgm, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pe, int k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gMatrix_8h.html#a840eba81029c72a610c3ba9fa794c336">releaseGatherEdge</a> (<a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> pgm, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pe)</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ab2c41215b98f316fe94885cf46f02e29"></a><!-- doxytag: member="gMatrix.h::NOT_GATHERED" ref="ab2c41215b98f316fe94885cf46f02e29" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="gMatrix_8h.html#ab2c41215b98f316fe94885cf46f02e29">NOT_GATHERED</a>&#160;&#160;&#160;-1</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>contiene: </p>
<ul>
<li>le strutture dati che rappresentano una matrice di g </li>
<li>le funzioni per gestire tale struttura dati in maniera semplice e velocese una cella del campo matrix assume questo valore allora l'arco associato a tale cella non e' soddisfatto da nessun camion </li>
</ul>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ab8c4af12319bc3765212016cf5445a5c"></a><!-- doxytag: member="gMatrix.h::GMatrix" ref="ab8c4af12319bc3765212016cf5445a5c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structGMatrix.html">GMatrix</a>  <a class="el" href="structGMatrix.html">GMatrix</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>rappresenta un matrice di interi. Ogni cella di tale matrice rappresenta il camion che ha soddisfato, in un qualunque momento dell'algoritmo l'arco (i;j) con i il numero di riga della matrice e j il numero di colonna della matrice. In caso il numero contenuto sia NOT_GATHERED, l'arco non è stato soddisfatto da nessun camion </p>

</div>
</div>
<a class="anchor" id="a8668af44d44e4df02f8db2210adc4982"></a><!-- doxytag: member="gMatrix.h::PGMatrix" ref="a8668af44d44e4df02f8db2210adc4982" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structGMatrix.html">GMatrix</a>* <a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>un puntatore ad una struttura <a class="el" href="structGMatrix.html">GMatrix</a> </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a986e2aa8b907c502bc90c43720d7dfd8"></a><!-- doxytag: member="gMatrix.h::amIGatheringEdge" ref="a986e2aa8b907c502bc90c43720d7dfd8" args="(PGMatrix p_gMatrix, PedgeID p_edgeID, int k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="gMatrix_8h.html#a986e2aa8b907c502bc90c43720d7dfd8">amIGatheringEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>p_gMatrix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>p_edgeID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>indica se un camion raccoglie un particolare arco </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>p_gMatrix non deve essere NULL </li>
<li>e non deve essere NULL </li>
<li>e deve avere i&lt;j (arco validato) </li>
<li>k&gt;=0 e k&lt;=K</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">p_gMatrix</td><td>un riferimento alla matrice </td></tr>
    <tr><td class="paramname">p_edgeID</td><td>puntatore all'arco da considerare </td></tr>
    <tr><td class="paramname">k</td><td>il camion da considerare </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE se il camion soddisfa l'arco, FALSE altrimenti </dd></dl>

</div>
</div>
<a class="anchor" id="a59e42cb9751a14215fcf6ba9fc7fbcf6"></a><!-- doxytag: member="gMatrix.h::cloneGMatrix" ref="a59e42cb9751a14215fcf6ba9fc7fbcf6" args="(PGMatrix matrix)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> <a class="el" href="gMatrix_8h.html#a59e42cb9751a14215fcf6ba9fc7fbcf6">cloneGMatrix</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Genera una nuova istanza di PGMatrix uguale tutto per tutto all'originale. La tabella mostra cosa viene copiato fisicamente e cosa invece viene semplicemente copiato per indirizzo</p>
<table class="doxtable">
<tr>
<th>Campo </th><th>Copia per...  </th></tr>
<tr>
<td>matrix </td><td>copia fisica  </td></tr>
<tr>
<td>N </td><td>copia per indirizzo  </td></tr>
</table>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>matrix non NULL; </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>una nuova martrice e' immagazzinata in memoria. <b>Deallocare</b> qualora non serva piu';</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">matrix</td><td>la matrice originale da copiare </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>un puntatore ad una nupva istanza di matrix (da deallocare manualmente qualora non serva piu') </dd></dl>

</div>
</div>
<a class="anchor" id="aff58909e3b768c5f155cb4cc570abadb"></a><!-- doxytag: member="gMatrix.h::freeGMatrix" ref="aff58909e3b768c5f155cb4cc570abadb" args="(PGMatrix matrix)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="gMatrix_8h.html#aff58909e3b768c5f155cb4cc570abadb">freeGMatrix</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>libera la memoria dalla matrice.</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>matrix non deve essere NULL </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd>tutta l'area in memoria occupata da matrix e' liberata. Non viene deallocata la cella puntata da N</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">matrix</td><td>un riferimento alla matrice da deallocare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a44cbe441c402fb796126df3182862d18"></a><!-- doxytag: member="gMatrix.h::gatherEdge" ref="a44cbe441c402fb796126df3182862d18" args="(PGMatrix pgm, PedgeID pe, int k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="gMatrix_8h.html#a44cbe441c402fb796126df3182862d18">gatherEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>pgm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>raccoglie l'arco specificato <b>senza</b> effettuare alcun controllo sul fatto che l'arco fosse gia' stato soddisfatto. <b>NON</b> vengono aggiornate le altre strutture di <a class="el" href="structSolution.html">Solution</a>, quindi si sconsiglia di usare questa funzione. Per una funzione che lascia senza conflitti le strutture uasre addEdgeIDInSolution() o removeEdgeIDInSolution().</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>ps non NULL </li>
<li>e non NULL </li>
<li>e ha i&lt;j </li>
<li>k&gt;=0 e k&lt;=K </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>l'arco e viene soddisfatto dal camion k </li>
<li>la matrice di g della soluzione ps ha nelle coordinate specificate da e il valore k</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">un</td><td>riferimento alla matrice </td></tr>
    <tr><td class="paramname">pe</td><td>puntatore all'arco da soddisfare </td></tr>
    <tr><td class="paramname">k</td><td>il camion che soddisfa la domanda </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa7c34686fbe4ead2d3a4c354565bda0a"></a><!-- doxytag: member="gMatrix.h::initGMatrix" ref="aa7c34686fbe4ead2d3a4c354565bda0a" args="(int *_N, int _basevalue)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a> <a class="el" href="gMatrix_8h.html#aa7c34686fbe4ead2d3a4c354565bda0a">initGMatrix</a> </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>_N</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>_basevalue</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>costruisce una nuova matrice G</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>il puntatore _N non deve essere NULL </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>un puntatore a <a class="el" href="structGMatrix.html">GMatrix</a> o NULL in caso di memoria non sufficiente</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">_N</td><td>un puntatore ad una cella in cui ci sian il numero di nodi del grafo </td></tr>
    <tr><td class="paramname">_basevalue</td><td>il valore da inserire in ogni cella della matrice </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>un riferimento alla matrice creata. </dd></dl>

</div>
</div>
<a class="anchor" id="a751162c0808d8bb942d02a1bdea1ec8a"></a><!-- doxytag: member="gMatrix.h::isEdgeGathered" ref="a751162c0808d8bb942d02a1bdea1ec8a" args="(PGMatrix pgm, PedgeID pe)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="gMatrix_8h.html#a751162c0808d8bb942d02a1bdea1ec8a">isEdgeGathered</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>pgm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pe</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>determina se l'arco e' raccolto o meno</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>ps non deve essere NULL </li>
<li>id non deve essere NULL </li>
<li>id deve avere i&lt;j</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">un</td><td>riferimento alla matrice </td></tr>
    <tr><td class="paramname">pe</td><td>puntatore all'arco interessato </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE se l'arco e' raccolto da un camion, FALSE altrimenti </dd></dl>

</div>
</div>
<a class="anchor" id="a16918ac489e56a65e094ff74c1ef9da5"></a><!-- doxytag: member="gMatrix.h::printGMatrix" ref="a16918ac489e56a65e094ff74c1ef9da5" args="(FILE *f, PGMatrix matrix)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="gMatrix_8h.html#a16918ac489e56a65e094ff74c1ef9da5">printGMatrix</a> </td>
          <td>(</td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>matrix</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>stampa la matrice matrix</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>un riferimento al file su cui scrivere la stampa </td></tr>
    <tr><td class="paramname">matrix</td><td>un riferimento alla matrix la matrice da stampare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a840eba81029c72a610c3ba9fa794c336"></a><!-- doxytag: member="gMatrix.h::releaseGatherEdge" ref="a840eba81029c72a610c3ba9fa794c336" args="(PGMatrix pgm, PedgeID pe)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="gMatrix_8h.html#a840eba81029c72a610c3ba9fa794c336">releaseGatherEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>pgm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pe</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Rilascia il riferimento alla raccolta dell'arco. </p>

</div>
</div>
<a class="anchor" id="a864195e0b74f3b55c4ff17c80c148010"></a><!-- doxytag: member="gMatrix.h::releaseIfImGatheringEdge" ref="a864195e0b74f3b55c4ff17c80c148010" args="(PGMatrix p_gMatrix, PedgeID p_edgeID, int k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="gMatrix_8h.html#a864195e0b74f3b55c4ff17c80c148010">releaseIfImGatheringEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>p_gMatrix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>p_edgeID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>rilascia un arco da parte di un veicolo, solo se egli lo raccoglieva per davvero. </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>p_gMatrix non deve essere NULL </li>
<li>e non deve essere NULL </li>
<li>e deve avere i&lt;j </li>
<li>k&gt;=0 e k&lt;=K</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">p_gMatrix</td><td>un riferimento alla matrice </td></tr>
    <tr><td class="paramname">p_edgeID</td><td>puntatore all'arco da considerare </td></tr>
    <tr><td class="paramname">k</td><td>il camion da considerare </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE se il camion soddisfava l'arco e pertanto ho rimosso, FALSE altrimenti </dd></dl>

</div>
</div>
<a class="anchor" id="a8b7e4bf17f06761e65a48e8dd415e826"></a><!-- doxytag: member="gMatrix.h::tryToGatherEdge" ref="a8b7e4bf17f06761e65a48e8dd415e826" args="(PGMatrix pgm, PedgeID pe, int k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="gMatrix_8h.html#a8b7e4bf17f06761e65a48e8dd415e826">tryToGatherEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>pgm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>tenta di raccogliere il profitto dato dall'arco: l'azione fallisce se l'arco era gia' stato raccolto da un altro camion precedentemente. <b>NON</b> vengono aggiornate le altre strutture di <a class="el" href="structSolution.html">Solution</a>, quindi si sconsiglia di usare questa funzione. Per una funzione che lascia senza conflitti le strutture uasre addEdgeIDInSolution() o removeEdgeIDInSolution().</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>ps non NULL </li>
<li>e non NULL </li>
<li>e ha i&lt;j </li>
<li>k&gt;=0 e k&lt;=K</li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>l'arco e viene soddisfatto. O da un camion precedente a questo oppure dal camion stesso</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">un</td><td>riferimento alla matrice </td></tr>
    <tr><td class="paramname">pe</td><td>puntatore all'arco da tentare di soddisfare </td></tr>
    <tr><td class="paramname">k</td><td>il camion che deve tentare di soddisfare e </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE se l'arco non era gia' stato raccolto da altri camion, FALSE altrimenti </dd></dl>

</div>
</div>
<a class="anchor" id="aaf280fbab5859ed2ed00952a71788397"></a><!-- doxytag: member="gMatrix.h::whoGathersEdge" ref="aaf280fbab5859ed2ed00952a71788397" args="(PGMatrix pgm, PedgeID pe)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="gMatrix_8h.html#aaf280fbab5859ed2ed00952a71788397">whoGathersEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="gMatrix_8h.html#a8668af44d44e4df02f8db2210adc4982">PGMatrix</a>&#160;</td>
          <td class="paramname"><em>pgm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pe</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>informa sul proprietario della raccolta di un arco. </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>ps non NULL </li>
<li>id non NULL </li>
<li>id deve avere i&lt;j</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">un</td><td>riferimento alla matrice </td></tr>
    <tr><td class="paramname">pe</td><td>puntatore all'edge interessato </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>l'identificativo del veicolo che raccoglie l'arco, oppure NOGATHERED se non è soddisfatto da alcun veicolo </dd></dl>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="gMatrix_8h.html">gMatrix.h</a>      </li>

    <li class="footer">Generated on Wed Sep 4 2013 06:38:56 for UCARPP by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
